package com.hxx.day4.front;

import com.hxx.day4.controller.HxxController;

import java.lang.reflect.WildcardType;
import java.util.Scanner;

public class HxxFront {
    public static void main(String[] args) {
        //创建控制层对象
        HxxController hxxController = new HxxController();
        //创建控制台
        Scanner scanner = new Scanner(System.in);
        //循环
        boolean flag = true;
        do{
            //提示信息
            System.out.println("1表示添加;2表示删除;3表示更新;4表示显示;5退出");
            int key = scanner.nextInt();
            switch (key){
                case 1:
                    hxxController.save(scanner);
                    break;
                case 2:
                    hxxController.delete(scanner);
                    break;
                case 3:
                    hxxController.update(scanner);
                    break;
                case 4:
                    hxxController.findAll();
                    break;
                case 5:
                    flag = false;
                    break;
            }
        }while (flag);

    }
}



















